<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>停止动画</title>
    <script src="./res/jquery-3.5.1.min.js"></script>
</head>

<body>
    <button id="wa">哇 帅哥</button><button id="pei">呸</button>
    <img src="./img/head.png" width="300px" alt="" style="position: absolute; left: 30px; top: 60px; display: none;">
</body>

</html>
<script>
    $(function(e) {
        $('#wa').click(function(e) {
            // e.preventDefault();
            $('img').slideDown(5000);
            $('img').slideUp(5000);
        });
        $('#pei').click(function(e) {
            // e.preventDefault();
            // 停止当前动画效果 但是 不会影响一下个动画效果
            $('img').stop();
        });
    });
</script>